home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group99a.txt
/
000073_icon-group-sender _Wed Mar 31 09:26:55 1999.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
2KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id JAA09376
for icon-group-addresses; Wed, 31 Mar 1999 09:26:48 -0700 (MST)
Message-Id: <199903311626.JAA09376@baskerville.CS.Arizona.EDU>
Date: Tue, 30 Mar 1999 22:47:27 -0500
From: Phillip Lee Thomas <teruthom@ix.netcom.com>
X-Accept-Language: en
To: Steve Graham <graham@cowboy.biomed.com>, icon-group@optima.CS.Arizona.EDU
Subject: Re: Problem reading binary file
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Steve,
Under DOS, the files need to be opened in "untranslated" mode:
in := open(args[1],"ru") | stop("Unable to open ",args[1])
out := open(args[2],"wu") | stop("Unable to open ",args[2])
This stops the translation of <CR><LF> and other characters with special
meaning in DOS.
Phillip
Steve Graham wrote:
> Hello.
>
> I am using MS-DOS Icon 9.1 to read a binary file. After reading 6
> characters, the program apparently quits reading. I have attached the
> relevant portion of the code:
>
> -------------------------- Code ------------------------------
> procedure main(args)
> #
> cnt := 0
> in := open(args[1],"r") | stop("Unable to open ",args[1])
> out := open(args[2],"w") | stop("Unable to open ",args[2])
> while character := reads(in,1) do {
> write(character," -->", ord(character))
> cnt := cnt+1
> }
> close(in,out)
> write(cnt," characters transferred")
> end
> -----------------------End of Code-------------------------
>
> I invoke the program with:
>
> word r99-0059.doc r99-0059.txt
>
> I get output of (some unprintable characters are represent by _):
>
> - -->208
> - -->207
> -->17
> _ -->224
> � -->161
> _ -->177
> 6 characters transferred
>
> Any ideas?
>
> Thanks in advance.
>
> -- Steve
>
> ______________________________________________________
>
> Steve Graham
> Laboratory Corporation of America (LabCorp)
> 12160 Abrams Road, Suite 601
> Dallas, Texas 75243
>
> E-mail: graham@cowboy.biomed.com
> Phone: 972.643.6124 (direct to desk)
> 972.437.5255 ext 5224
> FAX: 972.454.1040
> _______________________________________________________